/**
 * 
 */
package project.reguli;

import jess.Context;
import jess.JessException;
import jess.RU;
import jess.Userfunction;
import jess.Value;
import jess.ValueVector;

/**
 * @author Aarni
 * 
 */
public class ConstrangereTelevizor implements Userfunction {

	@Override
	public Value call(ValueVector arg0, Context arg1) throws JessException {

		int ora = arg0.get(2).intValue(arg1);
		String nume = arg0.get(1).stringValue(arg1);

		if (nume.equals("Televizor") && ora < 19 && ora > 9) {
			return new Value(4, RU.INTEGER);
		}

		return new Value(0, RU.INTEGER);

	}

	@Override
	public String getName() {
		return "ConstrangereTelevizor";
	}

}
